+ automatically refresh README screenshots - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f007db3939
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| branch="$GITHUB_REF_NAME" | ||
| generated_head=$(gh api "repos/$GITHUB_REPOSITORY/branches/$branch" --jq '.commit.sha') |
There was a problem hiding this comment.
Encode branch names before querying the generated head
On branches containing /—for example, the common feature/screenshots naming pattern—gh api sends this interpolated value as multiple URL path segments, while GitHub's Get a branch endpoint expects the branch name as one encoded path parameter. The lookup therefore returns 404 and the Generate job fails before it can dispatch CI; if screenshots were committed with GITHUB_TOKEN, that generated head receives no automatic CI run. Percent-encode branch before constructing this endpoint or obtain the head SHA without embedding the raw ref in the path; gh api --help likewise describes placeholder substitution, not automatic encoding of manually interpolated endpoint components (CLI manual).
Useful? React with 👍 / 👎.
f007db3 to
ba6b6bd
Compare
What changed
Generateworkflow for every non-mainworking-branch pushHawkynt/RepositoryTemplate/commit-generated-file@v1, preserving signed-commit branch protectionDesign
The screenshot implementation already existed in
ReadmeScreenshotTests; the missing piece was automatic pre-PR generation. This mirrors the established MassMediaEdit / RepositoryTemplate generated-file pattern and keeps full PR CI focused on verification rather than producing an uncommitted artifact.Validation
References
GITHUB_TOKEN-created commits and explicitworkflow_dispatchHawkynt/RepositoryTemplate/commit-generated-file@v1Hawkynt/MassMediaEdit/.github/workflows/generate.ymlNo new dependencies.